#!/usr/bin/sh

if [ $# -ne 6 ]; then
echo "Usage: sh launch.sh <erlang node name> <nodes> <files> <rep> <neighbors> <machines>"
exit 1
fi

NODE="$1"
SCRIPT="prj2server.erl"
NODES=$2
FILES=$3
REP=$4
NEIGHBORS=$5
MACHINES=$6

echo "$NODES $FILES $REP $NEIGHBORS"
echo "c(average). c(gossipprob). c(prj2server). c(db). c(fileupdate). c(fileretrieve). c(prj2). prj2:init($NODES, $FILES, $REP, $NEIGHBORS, $MACHINES). q()." | erl -name ${NODE}
